/*
 * CN_KNOCK_DOWN.cpp
 *
 *  Created on: 2013. 5. 21.
 *      Author: the2
 */

#include "../../User.h"
#include "CN_KNOCK_DOWN.h"

#include "../../NLogic/Space.h"

namespace ProjectZ { namespace NCommand { namespace NBattle {

void CN_KNOCK_DOWN::OnExecute(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;

	int16_t degree;
	int8_t action;
	int target_gid;
	int8_t ismonster;

	*pPacket >> degree >> action >> target_gid >> ismonster;

	NLogic::Space * pSpace = pUser->GetSpace();
	if (NULL == pSpace)
	{
		return;
	}

	::Network::Packet * pNoti = ::Network::GETPACKETPOOL()->SEND_NEW();
	*pNoti << degree << action << target_gid << ismonster;
	pNoti->MakePacket(CMD_SN_KNOCK_DOWN);

	pSpace->SendAllExceptMe(pNoti, pUser);
}

} /*NBattle*/ } /*NCommand*/ } /*ProjectZ*/
